<template>
	<view class="container">
		<view class="aboutList">
			<view class="item">
				<view class="name f30 c333">版本</view>
				<view class="text f30 c666">V{{ad}}</view>
			</view>
			<view class="item" @click="goyin">
				<view class="name f30 c333">用户协议</view>
				<view class="arrow"><image src="../../../static/images/arrow_right.png" mode="aspectFit"></image></view>
			</view>
		</view>
	</view>
</template>

<script>
export default {
	data() {
		return {
			phone: '',
			ad:'1.0'
		};
	},
	onLoad() {
		this.geng();
		this.how();
	},
	methods: {
		geng() {
			uni.getSystemInfo({
				success: function(res) {
					this.phone = res.platform;

					// console.log(res.platform);
				}
			});
		},
		how() {
			let header = { 'content-type': 'application/x--form-urlencoded' };
			header.token = uni.getStorageSync('userinfo').token;
			header.platform = this.phone;
			console.log(header);
			uni.request({
				url: 'http://dhapi.hg8851.cn/api/v1.check/version', //仅为示例，并非真实接口地址。
				method: 'POST',
				header,
				success: res => {
					console.log(res);
					this.ad=res.data.result.ver
				}
			});
		},
		goyin(){
			uni.navigateTo({
				url:'../../kitty-BasicLogin/yinsi'
			})
		}
	}
};
</script>

<style lang="scss">
page {
	background-color: #f7f4f8;
}
.aboutList {
	margin: 30upx 0;
	.item {
		background-color: $white-background;
		display: flex;
		flex-direction: row;
		align-items: center;
		justify-content: space-between;
		height: 105upx;
		line-height: 405upx;
		margin-bottom: 20upx;
		padding: 0 30upx;
		.arrow {
			image {
				width: 20upx;
				height: 35upx;
				vertical-align: middle;
			}
		}
	}
}
</style>
